build(ENG-12825): migrate packaging to uv + pyproject.toml#317
Draft
BartoszBlizniak wants to merge 3 commits into
Draft
build(ENG-12825): migrate packaging to uv + pyproject.toml#317BartoszBlizniak wants to merge 3 commits into
BartoszBlizniak wants to merge 3 commits into
Conversation
5 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the CLI’s packaging and dependency management from setup.py/setup.cfg + requirements.{in,txt} to pyproject.toml with uv.lock as the lockfile source of truth, and updates CI/dev bootstrap to use uv accordingly.
Changes:
- Replaces legacy packaging/requirements files with a
pyproject.toml-based build anduvdependency groups/lockfile workflow. - Updates GitHub Actions CI (tests + lint) and local
direnvbootstrap (.envrc) to install/run viauv. - Adds prompt unstyling for Click confirm prompts in non-TTY contexts and adjusts tests for newer Click behavior / contextmanager formatting.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Removed legacy setuptools packaging entrypoint in favor of pyproject.toml. |
| setup.cfg | Removed legacy wheel/pytest/coverage configuration now represented in pyproject.toml. |
| requirements.txt | Removed pip-tools compiled lockfile; uv.lock becomes the pinned source of truth. |
| requirements.in | Removed dev dependency input file; dev deps move to pyproject.toml dependency groups. |
| pyproject.toml | New packaging/build configuration, dependencies, and pytest/coverage config in one place. |
| CONTRIBUTING.md | Updates contributor setup instructions to reference uv + pyproject.toml/uv.lock. |
| cloudsmith_cli/core/tests/test_generic_detector.py | Makes environment detection test resilient by disabling AWS detector in context. |
| cloudsmith_cli/core/tests/test_detector_controls.py | Refactors multi-patch with statement into modern parenthesized form. |
| cloudsmith_cli/cli/utils.py | Adds maybe_unstyle_prompt() and routes confirmation prompts through it. |
| cloudsmith_cli/cli/tests/commands/test_tokens.py | Refactors stacked patch() calls into parenthesized with form. |
| cloudsmith_cli/cli/tests/commands/test_metadata.py | Adjusts assertion to unstyle output to avoid ANSI-split substrings. |
| cloudsmith_cli/cli/tests/commands/test_mcp.py | Refactors stacked patch() calls into parenthesized with form. |
| cloudsmith_cli/cli/tests/commands/test_check.py | Refactors stacked patch() calls into parenthesized with form. |
| AGENTS.md | Updates agent/dev guidance to reflect uv/pyproject.toml/uv.lock. |
| .github/workflows/test.yml | Switches matrix test job setup/install/run steps from pip to uv. |
| .github/workflows/lint.yml | Consolidates linting into a single uv + pre-commit job and adds concurrency control. |
| .envrc | Updates local bootstrap to uv sync --locked --group dev instead of pip/requirements files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- release.yml: replace `python setup.py sdist bdist_wheel` with `uv build` in both the build and publish-pypi jobs (setup.py was removed); add `astral-sh/setup-uv` steps (with caching disabled to satisfy zizmor's cache-poisoning audit on this tag-triggered publishing workflow); correct the pushed wheel filename from `*-py2.py3-none-any.whl` to `*-py3-none-any.whl` to match the new build output. - AGENTS.md: drop the reference to `packaging/constraints.txt`, which does not exist on this branch (it belongs to the separate binary-build work), keeping only the accurate pyproject.toml + uv.lock guidance. Declined (with evidence): - pyproject.toml license string: PEP 639 SPDX string `license = "Apache-2.0"` is valid for setuptools 82.0.1; `uv build` succeeds and emits `License-Expression: Apache-2.0` in METADATA. - Apache license classifier: PEP 639 supersedes license classifiers; adding it makes setuptools 82.0.1 raise InvalidConfigError and breaks the build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrate CLI packaging to
pyproject.toml+uv(with a lockeduv.lock) as a single source of truth, replacingsetup.py,setup.cfg, andrequirements.{in,txt}. CI (test.yml,lint.yml) now runs throughuv. No change to CLI behaviour.Type of Change
Additional Notes
uv buildproduces the same wheel + sdist.requirements.txtis removed;uv exportregenerates a pinned list if a consumer needs one.